#ifndef __PUZZLE_H__
#define __PUZZLE_H__

#include <vector>
using namespace std;
enum Direction
{
    LEFT,
    RIGHT,
    BACK,
    FORWARD,
    UP,
    DOWN,
    LAST_DIRECTION
};
struct Brick
{
    float pos[3]; //x, y, z
    bool isFinal;
};

class Puzzle
{
    Brick *blocks; 
    float ballPos[3];
    bool rot[2];
    bool solved;
    private:
        void rotate(int i1, int i2, bool ccw);

    public:
        float wc[3];
        Puzzle(int numTurns = 3, int numBlocksStraight = 4);
        ~Puzzle();
        //CCW pre caliculated x1 = y and y1 = h - x 
        //CC pre caliculate x1 = h - y  and y1 = x
        void rotXY(bool ccw = false);
        void rotZY(bool ccw = false);
        Brick * getBricks();
        float * getBallPos();
        bool isSolved(){return solved;}
        //function for updating the ball position
        void update();
};

#endif //__PUZZLE_H__
